<template>
	<template v-if="!item.subColumns || !item.subColumns.length">
		<el-table-column v-bind="item">
			<template #default="scope">
				<slot v-bind="scope"></slot>
			</template>
		</el-table-column>
	</template>
	<template v-else>
		<el-table-column v-bind="item">
			<table-column v-for="(subItem, index) in item.subColumns" :key="index" v-bind="subItem" :item="subItem">
				<template #default="scope">
					<slot v-bind="scope"></slot>
				</template>
			</table-column>
		</el-table-column>
	</template>

</template>

<script>
	import {
		ElTableColumn
	} from 'element-plus'

	export default {
		name: "li-table-column",
		components: {
			ElTableColumn
		},
		props: {
			item: {
				type: Object,
				default(){
					return {}
				}
			}
		},

		data() {
			return {

			};
		}
	}
</script>

<style lang="scss">

</style>